<ul class="sort-ul">
    <li class="<%= params[:sort].blank? ? 'active' : ''%>">
      <%= link_to request.query_parameters.merge({sort: nil}) do %>
        综合
      <% end %>
    </li>
    <li class="<%= params[:sort] == 'sales-desc' ? 'active' : ''%>">
      <%= link_to request.query_parameters.merge({sort: "sales-desc"}) do %>
        销量<i class="icon-list-page-di"></i>
      <% end %>
    </li>
    <li class="<%= params[:sort] == 'msrp-asc' ? 'active' : ''%>">
      <%= link_to request.query_parameters.merge({sort: "msrp-asc"}) do %>
        价格<i class="icon-list-page-di"></i>
      <% end %>
    </li>
    <li class="<%= params[:sort] == 'msrp-desc' ? 'active' : ''%>">
      <%= link_to request.query_parameters.merge({sort: "msrp-desc"}) do %>
        价格<i class="icon-list-page-gao"></i>
      <% end %>
    </li>
    <li>
      <span id="shuaixuan-btn">筛选<i class="icon-list-page-paixu"></i></span>
      <div class="shuaixuan-panel" style="display: none;">
          <div class="main-panel">
            <div class="pull-right">
              <button type="button" id="shuaixuan-panel-close-btn" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            </div>
            <% @root_categories.each_with_index do |cate, index| %>
              <div class="category">
                <h1><%= cate.title %></h1>
                <ul>
                  <% cate.children.each do |child| %>
                    <li class="category-li <%= child.id == params[:category_id].to_i ? 'active' : '' %>">
                      <%= link_to child.title, request.query_parameters.merge({category_id: child.id})%>
                    </li>
                  <% end %>
                </ul>
              </div>
            <% end %>

            <div class="category">
              <h1>品牌</h1>
              <ul>
                <% Brand.all.each_with_index do |brand, index| %>
                  <li class="category-li <%= index == 0 ? 'active' : '' %>">
                    <%= link_to brand.title, request.query_parameters.merge({brand: brand.id}) %>
                  </li>
                <% end %>
              </ul>
            </div>
          </div>
      </div>
    </li>
</ul>


<!-- <li class="<%= params[:sort].blank? ? 'active' : ''%>">
  <%= link_to request.query_parameters.merge({sort: nil}) do %>
    综合排序
  <% end %>
</li>
<li class="<%= params[:sort] == 'sales-desc' ? 'active' : ''%>">
  <%= link_to request.query_parameters.merge({sort: "sales-desc"}) do %>
    销量排序
    <i class="icon-list-page-di"></i>
  <% end %>
</li>
<li class="<%= params[:sort] == 'msrp-asc' ? 'active' : ''%>">
  <%= link_to request.query_parameters.merge({sort: "msrp-asc"}) do %>
    价格从低到高
    <i class="icon-list-page-gao"></i>
  <% end %>
</li>
<li class="<%= params[:sort] == 'msrp-desc' ? 'active' : ''%>">
  <%= link_to request.query_parameters.merge({sort: "msrp-desc"}) do %>
    价格从高到底
    <i class="icon-list-page-di"></i>
  <% end %>
</li> -->
